package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.MrqDictWeight;
import com.dhcc.DRGsHosp.facade.dto.MrqDictWeightDTO;

public class MrqDictWeightAssembler {
	
	public static MrqDictWeightDTO toDTO(MrqDictWeight mrqDictWeight){
		if( mrqDictWeight == null ){
			return null;
		}
		MrqDictWeightDTO mrqDictWeightDTO = new MrqDictWeightDTO();
		//没有setId
		mrqDictWeightDTO.setScoreCode(mrqDictWeight.getScoreCode());
		mrqDictWeightDTO.setWeightCode(mrqDictWeight.getWeightCode());
		mrqDictWeightDTO.setWeightName(mrqDictWeight.getWeightName());
		mrqDictWeightDTO.setWeightScore(mrqDictWeight.getWeightScore());
				
		return mrqDictWeightDTO;
	}
	
	public static List<MrqDictWeightDTO>  toDTOs(Collection<MrqDictWeight>  mrqDictWeightMore){
		if ( mrqDictWeightMore == null) {
			return null;
		}
		List<MrqDictWeightDTO> mdrdList = new ArrayList<MrqDictWeightDTO>();
		for (MrqDictWeight mrqDictWeight : mrqDictWeightMore) {
			mdrdList.add( toDTO(mrqDictWeight) );
		}
		return mdrdList;		
	}
	
	public static MrqDictWeight toEntity(MrqDictWeightDTO mrqDictWeightDTO){
		if( mrqDictWeightDTO == null ){
			return null;
		}
		MrqDictWeight mrqDictWeight = new MrqDictWeight();
		//没有setId
		mrqDictWeight.setScoreCode(mrqDictWeightDTO.getScoreCode());
		mrqDictWeight.setWeightCode(mrqDictWeightDTO.getWeightCode());
		mrqDictWeight.setWeightName(mrqDictWeightDTO.getWeightName());
		mrqDictWeight.setWeightScore(mrqDictWeightDTO.getWeightScore());
		
		return mrqDictWeight;
	}
	
	public static List<MrqDictWeight>  toEntities(Collection<MrqDictWeightDTO>  mrqDictWeightDTOMore){
		if ( mrqDictWeightDTOMore == null) {
			return null;
		}
		List<MrqDictWeight> mdrList = new ArrayList<MrqDictWeight>();
		for (MrqDictWeightDTO mrqDictWeightDTO : mrqDictWeightDTOMore) {
			mdrList.add( toEntity(mrqDictWeightDTO) );
		}
		return mdrList;		
	}
	
}
